home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 441 / aessrc12 / aesutrs1.s < prev    next >
Text File  |  1990-11-23  |  2KB  |  62 lines

  1.  
  2. ;*========================================================================
  3. ;*
  4. ;* AESFAST Public Domain GEM bindings.
  5. ;*
  6. ;*========================================================================
  7.  
  8. ;*************************************************************************
  9. ;*
  10. ;* AESUTRS1.S - Resource-related Utilities 1 of 3.
  11. ;*  Non-standard utility functions.
  12. ;*
  13. ;*************************************************************************
  14.  
  15.           .include  "gemfast.sh"
  16.  
  17. ;-------------------------------------------------------------------------
  18. ; rsc_strings - Set pointers to strings within a tree.
  19. ; rsc_sstrings  (New name).
  20. ;               This function sets one or more string pointers within a 
  21. ;               resource tree.  It knows the difference between strings
  22. ;               and buttons and text objects, and sets the ob_spec or
  23. ;               te_ptext pointer as appropriate. It accepts a variable
  24. ;               number of object/pointer pairs, with a negative object
  25. ;               index indicating the end of the list.
  26. ;
  27. ;  void rsc_sstrings(tree, obj1,ptr1 [,obj2,ptr2,...,objn,ptrn], -1);
  28. ;-------------------------------------------------------------------------
  29.  
  30. _rsc_sstrings::
  31. _rsc_strings::                ; old name retained for compatibility
  32.  
  33.           .cargs    #8,.ptree.l,.parms
  34.  
  35.           move.l    a2,-(sp)            ; Save Laser C register.
  36.           move.l    .ptree(sp),a2
  37.           lea       .parms(sp),a1
  38. .loop:
  39.           move.w    (a1)+,d2
  40.           bmi.s     .done
  41.           move.l    (a1)+,d0
  42.           muls      #OBJ_SIZ,d2
  43.           move.w    ob_type(a2,d2.l),d1
  44.           and.w     #$00FF,d1           ; remove extended object type data
  45.           cmp.w     #G_STRING,d1
  46.           beq.s     .string
  47.           cmp.w     #G_BUTTON,d1
  48.           beq.s     .string
  49. .text:    
  50.           move.l    ob_spec(a2,d2.l),a0
  51.           move.l    d0,(a0)
  52.           bra.s     .loop
  53. .string:
  54.           move.l    d0,ob_spec(a2,d2.l)
  55.           bra.s     .loop
  56. .done:
  57.           move.l    (sp)+,a2            ; Restore Laser C register.
  58.           rts
  59.           
  60. ;         end of code
  61.  
  62.